home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / sbprolog / amiga / v3_1 / sbp3_1e.lzh / BICOND.PL < prev    next >
Text File  |  1991-10-31  |  666b  |  32 lines

  1. /* From the book PROLOG PROGRAMMING IN DEPTH
  2.    by Michael A. Covington, Donald Nute, and Andre Vellino.
  3.    Copyright 1988 Scott, Foresman & Co.
  4.    Non-commercial distribution of this file is permitted. */
  5.  
  6. /* BICOND.PL */
  7. /* Extension of Prolog to handle
  8.    certain biconditionals */
  9.  
  10. /* The -:- operator joins the two
  11.    sides of a biconditional rule. */
  12.  
  13. :- op(950,xfx,'-:-').
  14.  
  15.  
  16. /* Inference engine for biconditionals */
  17.  
  18. prove(Goal)  :-  call(Goal).
  19.  
  20. prove(GoalA) :-  (GoalA -:- GoalB),
  21.                  call(GoalB).
  22.  
  23. prove(GoalB) :-  (GoalA -:- GoalB),
  24.                  call(GoalA).
  25.  
  26.  
  27. /* Sample knowledge base */
  28.  
  29. dog(fido).
  30. canine(rolf).
  31. dog(X) -:- canine(X).
  32.